<template>
    <h1>{{sum}}</h1>
</template>

<script>
    import {ref} from 'vue'

    export default {
        async setup()
        {
            let sum = ref('请求成功')

            // 异步请求处理
            let request = new Promise((resolve, reject) => {
                setTimeout(() => {
                    resolve({sum})
                }, 5000)
            })

            //返回请求对象
            return await request
        }
    }


</script>